#pragma once
#include <iostream>
#include <unistd.h>
#include <functional>
#include "Log.hpp"

using namespace LogModule;

//任务形式2
//定义一个返回值为空,参数为空的任务
using task_t = function<void()>;

void DownLoad()
{
    LOG(LogLevel::DEBUG) << "我是一个下载任务...";
}

//任务形式1
class Task
{
public:
    Task(){}

    Task(int x,int y): _x(x),_y(y)
    {

    }

    void Execute()
    {
        _result = _x + _y;
    }

    int X()
    {
        return _x;
    }

    int Y()
    {
        return _y;
    }

    int Result()
    {
        return _result;
    }

private:
    int _x;
    int _y;
    int _result;
};